package day5;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Avg5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int total = 0;
        int i = 1;
        for (; i <= 5; i++) {
            System.out.println("请输入：");
            int h = sc.nextInt();
            if (h < 0) {
                break;
            }
            total += h;
        }
        if(i>5){
            int avg = total / 5;
            System.out.println("平均分是：" + avg);
        }else{
            System.out.println("输入错误");
        }


    }
}
